
#pragma  once
#include <pch.hpp>
#include <cmath> // I use cpp version


// a lot of macro define here

#define INIT_ALL SDL_INIT_EVERYTHING
#define INIT_ALL_FUNC SDL_Init(INIT_ALL)
#define POS SDL_WINDOWPOS_CENTERED
#define W 800
#define H 600
#define NAME "test window"
#define SHOW SDL_WINDOW_SHOWN
// for createwindow, I want the api more simple
#define CREATEWINDOW (NAME), (POS), (POS),(W),(H),(SHOW)

#define ACC SDL_RENDERER_ACCELERATED
// for createRenderer, I want the api more simple
#define CREATERENDERER window, -1, (ACC)
// sdl color
#define COLORSET(r,g,b,a) 0x##r, 0x##g, 0x##b, 0x##a
// sdl rect
#define DEFAUTE_RECT 100, 100, 100, 100
#define DRAWRECT renderer, &rect
#define Present(renderer) SDL_RenderPresent(renderer)
#define DELAY(x) SDL_Delay(x)

#define MOSTCOMMWINDOWANDRENDERER SDL_Window *window = SDL_CreateWindow(CREATEWINDOW);SDL_Renderer *renderer = SDL_CreateRenderer(CREATERENDERER);
#define MOSTCOMMSUFANDTEXT_MAKE_NULL SDL_Surface *surface = NULL;SDL_Texture *texture = NULL;

#define MOSTCOMMWINDOWANDRENDER_FREE SDL_DestroyWindow(window);SDL_DestroyRenderer(renderer);
#define MOSTCOMMSUFANDTEXT_FREE   SDL_DestroyTexture(texture); SDL_FreeSurface(surface);

#define MAKEWAVES(path)  Mix_Chunk * waves = Mix_LoadWAV(path);
